package com.yan.demo.loopdemo;

public class WhileDemo2 {
    public static void main(String[] args) {
        System.out.println("奇数");
        int i = 1;
       while(i <= 100){
            if(i % 2 == 1 ){
                System.out.print(i + " ");
            }
            i++;
        }
        System.out.println();
        System.out.println("偶数");
        i = 1;
        while (i <= 100){
            if(i % 2 == 0 ){
                System.out.print(i + " ");
            }
            i++;
        }
    }
}
